<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>值的绑定</title>
</head>
<body>
    <script src="/js/vue.js"></script>
    <div id="app">
        <!-- <input type="checkbox" value="篮球" v-model="hobbies"> 篮球
        <input type="checkbox" value="排球" v-model="hobbies"> 排球
        <input type="checkbox" value="足球" v-model="hobbies"> 足球
        <input type="checkbox" value="乒乓球" v-model="hobbies"> 乒乓球
        <input type="checkbox" value="羽毛球" v-model="hobbies"> 羽毛球
        <h2>你的选择是{{hobbies}}</h2> -->

        <!-- 值绑定，动态的绑定值  -->
        <label :for="item"  v-for="item in hobbies">
            <input type="checkbox" :value="item" :id="item" v-model="myHobbise">{{item}}
        </label>
        <h2>{{myHobbise}}</h2>
    </div>

    <script>
        let app = new Vue({
            el:"#app",
            data:{ 
                hobbies:['篮球','排球','乒乓球','羽毛球','台球','足球','唱','跳','Rap'],
                myHobbise:[]
            }
        })
    </script>  
</body>
</html>